{% load i18n dv_filters %}
<tr {% if session.errors and user|can:'challenge_session_crud' %}class="warning"{% endif %} >
    {% if user|can:'challenge_session_crud' or session.visible or session.orga.coordinator == user %}
      <th>
        <a href="{% url 'session-detail' seasonpk=season.pk pk=session.pk %}">
          {{ session.day }} ({{ session.begin }}) {{ session.city }}
        </a>
      </th>
    {% else %}
      <td>
        {{ session.day }} ({{ session.begin }}) {{ session.city }}
      </td>
    {% endif %}
    <td>
        {% if user|can:'challenge_session_crud' %}
          {% if not session.visible %}
            <span class="badge pull-right" title="{% trans "Session invisible" %}"><span class="glyphicon glyphicon-eye-close"></span> </span>
          {% endif %}
          {% if session.errors %}
              <span class="glyphicon glyphicon-warning-sign"></span>
              {% if session.qualifications.count == 0 %}
                  {% trans "Aucune Qualif’" %}
              {% elif session.has_availability_incoherences %}
                  {% trans "Qualif’ incohérente" %}
              {% else %}
                  {% trans "Incomplet" %}
              {% endif %}
          {% else %}
            {% include "ok.html" %}
          {% endif %}
        {% endif %}
    </td>
    <td>
        {% if user|can:'challenge_session_crud' %}
            <a class="btn btn-default btn-xs" title="{% trans "Dupliquer" %}" href="{% url 'session-clone' seasonpk=season.pk pk=session.pk %}"><span class="glyphicon glyphicon-copy"></span></a>
        {% endif %}
        {% if session.qualifications.count != 0 and session.visible %}
            <a href="{% url 'session-staff-choices' seasonpk=season.pk pk=session.pk %}">{% trans "Présences" %}</a>
        {% endif %}
    </td>
</tr>
